package cn.com.mrAdv03;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class MyselfGroupComparator extends WritableComparator {
	public MyselfGroupComparator() {
	      super(MyselfIntWritable.class, true);
	}
	
	@Override
	public int compare(WritableComparable a, WritableComparable b) {
		if(a == null || b == null) {
			return 0;
		}
		MyselfIntWritable a1 = (MyselfIntWritable) a;
		MyselfIntWritable b1 = (MyselfIntWritable) b;
		return (a1.getNumber() % 100 == 0) && (b1.getNumber() % 100 == 0) ? 0 : 1;
	}
}
